//
//  LHRecommendHomePageView.m
//  Knight_Tour
//
//  Created by 庞魁 on 15-5-14.
//  Copyright (c) 2015年 TouchOne. All rights reserved.
//

#import "LHRecommendHomePageView.h"

@interface LHRecommendHomePageView ()
@property (nonatomic, retain) UIImageView *HolImageView;
@property (nonatomic, retain) UIImageView *ResImageView;
@property (nonatomic, retain) UILabel *CityLabel;
@property (nonatomic, retain) UILabel *TourLabel;
@property (nonatomic, retain) UILabel *popularNotes;
@property (nonatomic, retain) UILabel *henXian;


@end

@implementation LHRecommendHomePageView

- (void)dealloc
{
    [_HolImageView release];
    [_ResImageView release];
    [_CityLabel release];
    [_TourLabel release];
    [_popularNotes release];
    [_henXian release];
    
    [super dealloc];
    
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self createTitleView];
    }
    
    return self;
    
}

/**
 *  创建推荐游四个标签视图
 */
- (void)createTitleView
{
    
    
    self.HolImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.frame.size.width / 7 - 5, 15, self.frame.size.width /7 , self.frame.size.width / 7)];
    
    _HolImageView.image =[UIImage imageNamed:@"lieche"];
    
    _HolImageView.layer.cornerRadius = 20;
    _HolImageView.clipsToBounds =YES;
    
    [self addSubview:_HolImageView];
    
    [_HolImageView release];
    
    
    self.TourButton = [UIButton buttonWithType:UIButtonTypeSystem];
    
    _TourButton.frame = CGRectMake(_HolImageView.frame.origin.x + self.frame.size.width / 7 + 20, 15, self.frame.size.width / 7, self.frame.size.width / 7);
    
    [_TourButton setBackgroundImage:[UIImage imageNamed:@"youji"] forState:UIControlStateNormal];
    
    _TourButton.layer.cornerRadius = 20;
    _TourButton.clipsToBounds = YES;
    
    [self addSubview:_TourButton];
    
    
    self.TourLabel = [[UILabel alloc] initWithFrame:CGRectMake(_HolImageView.frame.origin.x + self.frame.size.width / 7 + 20, _TourButton.frame.origin.y + self.frame.size.width / 7 + 5, self.frame.size.width / 7, 20)];
    
    [_TourLabel setFont:[UIFont fontWithName:@"Helvetica-Bold" size:15]];
    
    [_TourLabel setTextColor:[UIColor colorWithRed:0.033 green:0.028 blue:0.044 alpha:1.000]];
    
    _TourLabel.text = @"游记";
    
    [_TourLabel setTextAlignment:NSTextAlignmentCenter];
    
    [self addSubview:_TourLabel];
    
    [_TourLabel release];
    
    
    self.CityButton = [UIButton buttonWithType:UIButtonTypeSystem];
    
    _CityButton.frame = CGRectMake(_TourButton.frame.origin.x + self.frame.size.width / 7 + 20, 15, self.frame.size.width / 7, self.frame.size.width / 7);
    
    [_CityButton setBackgroundImage:[UIImage imageNamed:@"chengshi"] forState:UIControlStateNormal];
    
    _CityButton.layer.cornerRadius = 20;
    _CityButton.clipsToBounds = YES;
    
    [self addSubview:_CityButton];
    
    
    self.CityLabel = [[UILabel alloc] initWithFrame:CGRectMake(_TourButton.frame.origin.x + self.frame.size.width / 7 + 20, _CityButton.frame.origin.y + self.frame.size.width / 7 + 5, self.frame.size.width / 7, 20)];
    
    [self addSubview:_CityLabel];
    
    [_CityLabel setTextAlignment:NSTextAlignmentCenter];
    
    [_CityLabel setFont:[UIFont fontWithName:@"Helvetica-Bold" size:15]];
    
    [_CityLabel setTextColor:[UIColor colorWithRed:0.033 green:0.028 blue:0.044 alpha:1.000]];
    
    _CityLabel.text = @"城市";
    
    [_CityLabel release];
    
    
    
    self.ResImageView = [[UIImageView alloc] initWithFrame:CGRectMake(_CityButton.frame.origin.x + self.frame.size.width / 7 + 20, 15, self.frame.size.width / 7, self.frame.size.width / 7)];
    
    _ResImageView.image = [UIImage imageNamed:@"gexing"];
    
    _ResImageView.layer.cornerRadius = 20;
    _ResImageView.clipsToBounds = YES;
    
    [self addSubview:_ResImageView];
    
    [_ResImageView release];
    
    
    self.popularNotes = [[UILabel alloc] initWithFrame:CGRectMake(10, _CityLabel.frame.origin.y + _CityLabel.frame.size.height, 80, 20)];
    
    _popularNotes.text = @"热门游记";
    
    [_popularNotes setFont:[UIFont fontWithName:@"Helvetica-Bold" size:15]];
    
    [_popularNotes setTextColor:[UIColor blackColor]];
    
    [self addSubview:_popularNotes];
    
    [_popularNotes release];
    
    self.henXian = [[UILabel alloc] initWithFrame:CGRectMake(_popularNotes.frame.origin.x + _popularNotes.frame.size.width + 2, _popularNotes.frame.origin.y + 8, self.frame.size.width - _popularNotes.frame.origin.x - _popularNotes.frame.size.width, 3)];
    
    _henXian.backgroundColor =[UIColor colorWithRed:0.760 green:0.759 blue:0.936 alpha:1.000];
    
    [self addSubview:_henXian];
    
    [_henXian release];
    
}










/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
